package ch.phovoz.tlog;

import java.util.Date;

import ch.phovoz.tlog.database.DatabaseManager;

import controller.DatabaseController;
import controller.Exercise;
import controller.Training;
import android.app.Activity;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

public class Exersice extends Activity {

	private DatabaseController dbc;
	private InfoObject infoobject;
	

	
	
	public void onCreate(Bundle savedInstanceState) {
		dbc=new DatabaseController(this);
		infoobject=InfoObject.getInfoObject();
		
	

	 super.onCreate(savedInstanceState);
     setContentView(R.layout.exersice);
     
     
     TextView currentExersiceView = (TextView)this.findViewById(R.id.currentChoosedExersice);
     currentExersiceView.setText(dbc.getExersice(InfoObject.getCurrentExersice()));
 
     
     
     
     
	}
	
	public void onAddRepButtonklick(View view){
		
		EditText editrRepText = 
				(EditText) findViewById(R.id.exersiceEditReps);
		String reps = editrRepText.getText().toString();
		
		
		EditText editrWeigtText = 
				(EditText) findViewById(R.id.exersiceEditWeight);
		String weights = editrWeigtText.getText().toString();
		
		
		dbc.addSet(weights,reps);
		
		
	}
	
	
}
